/*
 * @Author: wangzhichiao<https://github.com/wzc570738205>
 * @Date: 2020-03-25 10:43:16
 * @LastEditors: wangzhichiao<https://github.com/wzc570738205>
 * @LastEditTime: 2020-04-26 14:12:10
 */
import request from "@/utils/request";
/**数据目录服务 */
var dataDirectoryService = {
  /**
   * @description: 查询出所有部门
   * @param {type}
   * @return:
   */
  getOrgContentsNum() {
    return request({
      url: "/DoorManagement/contents/getOrgContentsNum",
      method: "get",
      params: {}
    });
  },
  /**
   * @description: 查询出所有地市
   * @param {type}
   * @return:
   */
  getCityContentsNum() {
    return request({
      url: "/DoorManagement/contents/getCityContentsNum",
      method: "get",
      data: {}
    });
  },
  /**
   * @description: 查询出所有主题
   * @param {type}
   * @return:
   */
  getAllSubjects() {
    return request({
      url: "/DoorManagement/subject/getSubjectContentNum",
      method: "get",
      data: {}
    });
  },
  /**
   * @description: 查询出所有接入方式
   * @param {type}
   * @return:
   */
  getAllSharingMode() {
    return request({
      url: "/DoorManagement/sharingMode/getAllSharingMode",
      method: "get",
      data: {}
    });
  },
  /**
   * @description: 数据目录分页条件查询
   * @param {type}
   * @return:
   */
  getsearchContentsData(param) {
    return request({
      url: "/DoorManagement/contents/searchContentsData",
      method: "post",
      data: param
    });
  },
  /**
   * @description: 根据目录id查找目录基本信息
   * @param {type}
   * @return:
   */
  getBaseContentsById(param) {
    return request({
      url: "/DoorManagement/contents/getBaseContentsById",
      method: "post",
      params: param
    });
  },
  /**
   * @description: 评价目录
   * @param {type}
   * @return:
   */
  scoreContent(param) {
    return request({
      url: "/DoorManagement/score/scoreContent",
      method: "post",
      params: param
    });
  },
  /**
   * @description: 判断此用户是否已经评价过此目录
   * @param {type}
   * @return:
   */
  getScoreByContentId(param) {
    return request({
      url: "/DoorManagement/score/getScoreByContentId",
      method: "post",
      params: param
    });
  },
  /**
   * @description: 取消收藏
   * @param {type}
   * @return:
   */
  canceCollection(param) {
    return request({
      url: "/DoorManagement/collection/canceCollection",
      method: "post",
      params: param
    });
  },
  /**
   * @description: 收藏
   * @param {type}
   * @return:
   */
  confirmCollection(param) {
    return request({
      url: "/DoorManagement/collection/confirmCollection",
      method: "post",
      params: param
    });
  },
  /**
   * @description: 判断目录是否被收藏
   * @param {type}
   * @return:
   */
  isContentCollection(param) {
    return request({
      url: "/DoorManagement/collection/isContentCollection",
      method: "post",
      params: param
    });
  },
  /**
   * @description: 订阅
   * @param {type}
   * @return:
   */
  confirmSubscribe(param) {
    return request({
      url: "/DoorManagement/subscribe/confirmSubscribe",
      method: "post",
      data: param
    });
  },
  /**
   * @description: sf订阅
   * @param {type}
   * @return:
   */
  isContentSubscribe(param) {
    return request({
      url: "/DoorManagement/subscribe/isContentSubscribe",
      method: "post",
      params: param
    });
  },
  /**
   * @description: 根据目录id查找接口信息
   * @param {type}
   * @return:
   */
  getTasksByContentId(param) {
    return request({
      url: "/DoorManagement/task/getTasksByContentId",
      method: "post",
      data: param
    });
  },
  /**
   * @description: api接口调用
   * @param {type}
   * @return:
   */
  testApi(url, param) {
    return request({
      url: url,
      method: "post",
      data: param
    });
  },
  /**
   * @description: 根据目录id查找目录字段
   * @param {type}
   * @return:
   */
  getFieldsByContentId(param) {
    return request({
      url: "/DoorManagement/contentsField/getFieldsByContentId",
      method: "post",
      params: param
    });
  },
  /**
   * @description: 数据预览
   * @param {type}
   * @return:
   */
  latestData(param) {
    return request({
      url: "/tool/latestData",
      method: "get",
      params: param
    });
  },
  /**
   * @description: 数据预览
   * @param {type}
   * @return:
   */
  downloadallData(param) {
    return request({
      url: "/tool/exportAllData",
      method: "get",
      params: param,
      headers: { showLoading: false ,'Content-Type':'application/zip','Accepte':'application/zip'},
      responseType: 'arraybuffer',
    });
  },
  /**
   * @description: 数据预览
   * @param {type}
   * @return:
   */
  downloadFtpHolder(param) {
    return request({
      url: "/tool/downloadFtpHolder",
      method: "get",
      params: param,
      headers: { showLoading: false ,'Content-Type':'application/zip','Accepte':'application/zip'},
      
    });
  }
  ,
  /**
   * @description: 文件下载查询
   * @param {type}
   * @return:
   */
  downloadinfo(param) {
    return request({
      url: "/tool/allData",
      method: "get",
      params: param,
			headers: { showLoading: false }
    });
  }
};
export { dataDirectoryService };
